<template>
  <div id="app">
    <router-view />
    <!-- <button>{{ $t('loginBtn') }}</button> -->
  </div>
</template>

<script>
import request from '@/utils/request'
// import request from '@/utils/request2'
export default {
  name: 'App',
  data() {
    return {
    }
  },
  created() {
    this.testData()
    this.testData2()
  },
  methods: {
    async testData() {
      const res = await request({
        url: '/news/toplist',
        method: 'get',
        params: {
          page: 1,
          size: 10
        }
      })
      console.log(res)
    },
    // 测试mock数据模拟
    async testData2() {
      const res = await request({
        url: '/product/center',
        method: 'post',
        data: {
          productName: '洗衣机', price: 8888
        }
      })
      console.log(res)
    }
  }
}
</script>
